<?php
/**
 * 队列，提供给内容，更新内容关联的wiki数量
 */

use Biz\module\Classes\wiki\RelateWiki as clsRelateWiki;
use Doraemon\tools\Log;

class SetWikisNumByObjIdAction extends QueueActionPlugin
{
    public function main()
    {
        $objId = $this->getRequest()->getPost("obj_id");
        $objType = $this->getRequest()->getPost("obj_type");
        Log::wiki_setObjWikisNumQue_info(json_encode(['obj_id' => $objId, 'obj_type' => $objType]));
        if ($objId && $objType) {
            clsRelateWiki::setWikisNumByObjId($objId, $objType);
            $this->setSuccess();
        } else {
            throw new \Exception('传递参数错误', -1);
        }
    }
}